function byId(ele) {
	return document.getElementById(ele);
}
function getSelected(areas) {
var area_codes='';
	for ( var i = 0; i < areas.length; i++ ) {
		if (areas.options[i].selected) {
			area_codes+=(areas.options[i].value+",");
		}
	}
return area_codes;
}

function constructRequest() {
	var email = byId("email").value;
	var areas = byId("area_codes");
	var area_codes = getSelected(areas);
	var hours = byId("hours");
	var imgUrl = "static/img/l.gif";
	var daystr = "1,2,3,4,5";
	var daily = byId("everyday").checked;
	
	if (daily) {
	daystr+=",6,0";
	}
	for (var i = 0; i < hours.length; i++) {
	if (hours.options[i].selected) {
	var params= "service=NEW_ALERT&email="+email+"&"+"area_codes="+area_codes+"&hours="+hours.options[i].value*60+"&days="+daystr;
	(new Image()).src=imgUrl+"?"+params;
	}
	}
	
}
